package com.qsxc.dao.mapper;

import com.qsxc.business.promoter.bean.vo.DivideRecordVo;
import com.qsxc.dao.entity.SmPromoterDivideRecord;
import com.qsxc.system.config.mybatis.MyBaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 推广员分成记录表，支付成功后生成 Mapper 接口
 * </p>
 *
 * @author
 * @since 2024-09-25
 */
@Mapper
public interface SmPromoterDivideRecordMapper extends MyBaseMapper<SmPromoterDivideRecord> {
    /**
     * 根据推广员ID、记录ID查询分成记录列表
     *
     * @param promoterId
     * @return
     */
    List<SmPromoterDivideRecord> queryListByPromoterIdAndIds(@Param("promoterId") Long promoterId, @Param("idArray") String[] ids);

    /**
     * 根据推广员id查询分成记录列表
     *
     * @param promoterId
     * @return
     */
    List<DivideRecordVo> queryListByPromoterIdAndCashType(@Param("promoterId") Long promoterId, @Param("cashType") String cashType);

    /**
     * 根据提现记录id查询分成记录列表
     *
     * @param cashRecordId
     * @return
     */
    List<DivideRecordVo> queryListByCashRecordId(@Param("cashRecordId") Long cashRecordId);

    /**
     * 根据推广员id查询总分成金额
     *
     * @param promoterId
     * @return
     */
    Double getTotalDivideFunds(@Param("promoterId") Long promoterId);
}
